package com.game.chat_room;

import com.game.tools.LogTool;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;

@Component
@Order(value = 1)
public class ChatroomServer implements ApplicationRunner {
    @Autowired
    private ServerListener serverListener;

    @Override
    public void run(ApplicationArguments args) throws Exception {
        LogTool.outputLog("聊天服务器 ChatroomServer: 准备启动 ServerListener...");
        serverListener.start();
        LogTool.outputLog("聊天服务器 ChatroomServer:  ServerListener 已启动");
        ChatThreadManager.getChartManager().run();
    }
}
